ThisBuild / version := "0.1.0-SNAPSHOT"

ThisBuild / scalaVersion := "2.12.15"

lazy val root = (project in file("."))
  .settings(
    name := "SparkReadHBase"
  )

val sparkVersion = "3.2.2"
val hbaseVersion = "2.4.18"
val hadoopVersion = "3.3.6"

// connector这里如果用1.0.0会报错 https://repo1.maven.org.../avro-mapred-1.11.0-hadoop2.jar: not found:....
val hbaseSparkConnectorVersion = "1.0.1"

libraryDependencies += "org.apache.spark" %% "spark-core" % sparkVersion
libraryDependencies += "org.apache.spark" %% "spark-sql" % sparkVersion
// java.lang.ClassNotFoundException: org.apache.spark.streaming.dstream.DStream
libraryDependencies += "org.apache.spark" %% "spark-streaming" % sparkVersion

// HBase Spark连接器
libraryDependencies += "org.apache.hbase.connectors.spark" % "hbase-spark" % hbaseSparkConnectorVersion
// excludeAll(
//    ExclusionRule(organization = "org.apache.hadoop"),
//    ExclusionRule(organization = "org.apache.hbase")
//  )

// HBase客户端
libraryDependencies += "org.apache.hbase" % "hbase-client" % hbaseVersion
libraryDependencies += "org.apache.hbase" % "hbase-common" % hbaseVersion

libraryDependencies += "org.apache.hadoop" % "hadoop-common" % hadoopVersion
libraryDependencies += "org.apache.hadoop" % "hadoop-hdfs" % hadoopVersion

//libraryDependencies += "org.slf4j" % "slf4j-api" % "1.7.36"
//
//libraryDependencies += "ch.qos.logback" % "logback-classic" % "1.2.11"
//
// 解决依赖冲突
//dependencyOverrides ++= Seq(
//  "com.fasterxml.jackson.core" % "jackson-core" % "2.13.3",
//  "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.3",
//  "com.fasterxml.jackson.module" %% "jackson-module-scala" % "2.13.3",
//  "org.apache.hadoop" % "hadoop-client" % "3.3.4"
//)

